﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Collections;

namespace TemplateWeb.Helpers
{
    public static class WebConfiguration
    {
        /// <summary>
        /// Returns the maximum number of products to be displayed on a page
        /// </summary>
        public static int ProductsPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]);
            }
        }

        public static int NumInfoPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumInfoPerPage"]);
            }
        }

        /// <summary>
        /// Returns the length of product descriptions in products lists
        /// </summary>
        public static string SiteName
        {
            get
            {
                return ConfigurationManager.AppSettings["SiteName"];
            }
        }

        /// <summary>
        /// Returns the address of the mail server 
        /// </summary>
        public static string MailServer
        {
            get
            {
                return ConfigurationManager.AppSettings["MailServer"];
            }
        }

        /// <summary>
        /// Send error log emails? 
        /// </summary>
        public static bool EnableErrorLogEmail
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["EnableErrorLogEmail"]);
            }
        }

        /// <summary>
        /// Returns the email address where to send error reports 
        /// </summary>
        public static string ErrorLogEmail
        {
            get
            {
                return ConfigurationManager.AppSettings["ErrorLogEmail"];
            }
        }

        public static string EmailLienHe { get; set; }
        public static string PasswordEmailLienHe { get; set; }
        //public static string EmailLienHe = "lsytuan@gmail.com";
        //public static string PasswordEmailLienHe = "lst8497929";

        public static int NumNguoiDungPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumNguoiDungPerPage"]);
            }
        }

        public static int NumCongTyThamDinhGiaPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumCongTyThamDinhGiaPerPage"]);
            }
        }

        public static int NumGopYPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumGopYPerPage"]);
            }
        }

        public static int NumLoaiHinhThamDinhGiaPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumLoaiHinhThamDinhGiaPerPage"]);
            }
        }

        public static int NumPhanHoiPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumPhanHoiPerPage"]);
            }
        }

        public static int NumPhapLyPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumPhapLyPerPage"]);
            }
        }

        public static int NumSLM_MembersPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumSLM_MembersPerPage"]);
            }
        }

        public static int NumHoTroPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumHoTroPerPage"]);
            }
        }

        // SORT DESCRIPTION
        public static int PhapLySortDescription
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["PhapLySortDescription"]);
            }
        }

        public static int GopYSortDescription
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["GopYSortDescription"]);
            }
        }

        public static int CongTyThamDinhGiaSortDescription
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["CongTyThamDinhGiaSortDescription"]);
            }
        }

        public static int LoaiHinhThamDinhGiaSortDescription
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["LoaiHinhThamDinhGiaSortDescription"]);
            }
        }

        public static int GioiThieuCongTySortDescription
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["GioiThieuCongTySortDescription"]);
            }
        }

        public static string CurrentAction { get; set; }
        public static string CurrentController { get; set; }
        public static bool AllowAccessAdminCP = false;
        public static bool IsRequestAuthentication { get; set; }
        public static string UserNameAuthentication { get; set; }
        public static ArrayList ArrWhether { get; set; }
        // ------------------------------------------ E -----------------------------------------------
    }
}